#!/usr/bin/env python
# -*- coding: cp1252 -*-

import sys

class Printer():
    """
    Print things to stdout on one line dynamically
    """

    def __init__(self,data):

        sys.stdout.write("%s              \r" % data.__str__())
        sys.stdout.flush()

def is_integer(s):
    try:
        int(s)
        return True
    except ValueError:
        return False

def is_number(s):
    try:
        float(s) # for int, long and float
    except ValueError:
        try:
            complex(s) # for complex
        except ValueError:
            return False

    return True
